
import requestUtil from '../util/RequestUtil';

export const getUserList = () => {
  const postData = {
    "Action": "DescribeTeamMembers",
    "PageNumber": 1,
    "PageSize": 100
  };

  return requestUtil.post("/open-api", postData);
}


export const getUserProjectList = (userId: number) => {
  const postData = {
    "Action": "DescribeUserProjects",
    "userId": userId
  };

  return requestUtil.post("/open-api", postData);
}

export const getUserProjectIssueList = (userId: string, projectName: string) => {
  const postData = {
    "Action": "DescribeIssueListWithPage",
    "ProjectName": projectName,
    "IssueType": "ALL",
    "ShowSubIssues": true,
    "SortKey": "PRIORITY",
    "PageNumber": 1,
    "PageSize": 200,
    "Conditions": [{
      "Key": "ASSIGNEE",
      "Value": userId
    }
    ]
  };

  return requestUtil.post("/open-api", postData);
}